package com.fjxd.plane.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fjxd.feign.clients.FlightNumberClient;
import com.fjxd.plane.mapper.AirlinesMapper;
import com.fjxd.plane.mapper.PlaneMapper;
import com.fjxd.plane.pojo.Airlines;
import com.fjxd.plane.pojo.Plane;
import com.fjxd.plane.service.PlaneService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author wz
 */
@Service
public class PlaneServiceImpl extends ServiceImpl<PlaneMapper, Plane> implements PlaneService {
    @Autowired
    private PlaneMapper planeMapper;
    @Autowired
    private AirlinesMapper airlinesMapper;

    @Override
    public List<Plane> getPlaneAll() {
        return planeMapper.getPlaneAll();
    }

    @Override
    public Plane getPlaneById(Integer id) {
//        Plane plane = planeMapper.getPlaneById(id);
//        plane.setAirlines(airlinesMapper.selectById(plane.getAId()));
        return planeMapper.getPlaneById(id);
    }

    @Override
    public int addPlane(Plane plane){
        return planeMapper.addPlane(plane);
    };


}
